package com.lbd99.data.lbd.controller;

import com.lbd99.data.lbd.service.XDepartmentService;
import com.lbd99.data.lbd.vo.XDepartment;
import com.lbd99.data.utils.AjaxJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v/department")
//@Api(tags = "部门管理", value = "XDepartmentController")
public class XDepartmentController {

    @Autowired
    private XDepartmentService xDepartmentService;

    @RequestMapping(value = "/selectList", method = RequestMethod.POST)
    //@ApiOperation(value = "查询列表信息")
    public AjaxJson selectList() {
        AjaxJson json = null;
        try {
            List<XDepartment> list = xDepartmentService.selectList(null);
            json = new AjaxJson();
            json.put("list", list);
        } catch (Exception e) {
            json = AjaxJson.returnExceptionInfo("查询列表信息失败" + e);
        }
        return json;
    }
}